import request from '@/utils/request'

export default {
    /**
     * 获取分类列表
     * @returns 
     */
    getCategoryData(id) {
        return request({
            url: '/category',
            method: 'get',
            params: {
                id: id
            }
        })
    },

    /**
     * 获取二级分类列表
     * @returns
     */
    getSubCategoryData(id) {
        return request({
            url: '/category/sub/filter',
            method: 'get',
            params: {
                id: id
            }
        })
    },

    /**
     * @description获取二级分类数据列表
     * @Data {
     * category_id: 1,
     * page: 1,
     * pageSize: 20,
     * sortField: 'publishTime || 'orderNum' || 'evaluateNum'',
     * }
     * @returns
     */
    getSubCategoryListData(data) {
        return request({
            url: '/category/goods/temporary',
            method: 'post',
            data: data
        })
    }
}